﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using DotSpatial.Topology;

namespace HAGISV2
{

    /// <summary>
    /// 用于表示图形中的PART部分
    /// </summary>
    [Serializable]
    public class VectorShapePart
    {


        public VectorShapePart(List<Coordinate> coords)
        {

            this._keyCoords.AddRange(coords);
 
        }

        public VectorShapePart(Coordinate[] coords)
        {
            this._keyCoords.AddRange(coords);
 
        }

        public VectorShapePart(Coordinate coord)
        {
            this._keyCoords.Add(coord);
 
        }



        //所有点坐标
        protected List<Coordinate> _normalCoords = new List<Coordinate>();



        /// <summary>
        /// 用于计算实际绘制点
        /// </summary>
        /// <returns></returns>
        protected virtual void ComputeNormalCoords()
        {
            this._normalCoords.Clear();

            this._normalCoords.AddRange(this._keyCoords);


 
        }



        /// <summary>
        /// 实际表示用的所有点坐标
        /// </summary>
        public List<Coordinate> NormalCoords
        {
            get {

                //如果每次都需要经过此属性的话，需要考虑性能损失
                this.ComputeNormalCoords();

                return _normalCoords;
            
            
            }

        }





        //图形关键点坐标,编辑用
        protected List<Coordinate> _keyCoords = new List<Coordinate>();

        /// <summary>
        /// 定义实体的关键坐标
        /// </summary>
        public List<Coordinate> KeyCoords
        {
            get { 
                
                
                return _keyCoords; 
            
            
            }

        }


    }
}
